win32: Add fallback drawing code for window frames
authorBenjamin Otte <otte@redhat.com>
Sat, 27 Feb 2016 13:16:50 +0000 (14:16 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 27 Feb 2016 13:34:33 +0000 (14:34 +0100)
gtk/gtkwin32draw.c

index d30884ff78a1c765b7791db9a2f007d9b836fe13..d5f7b0d5f8f50bca79e91a94ca2c9a1c36bd096c 100644 (file)
@@ -309,9 +309,53 @@ draw_window (cairo_t *cr,
              int      width,
              int      height)
 {
+  draw_edge (cr, EDGE_RAISED, 0, 0, width, height + 2);
+
   gtk_cairo_set_source_sys_color (cr, state == 2 ? GTK_WIN32_SYS_COLOR_INACTIVECAPTION
                                                  : GTK_WIN32_SYS_COLOR_ACTIVECAPTION);
-  cairo_rectangle (cr, 0, 0, width, height);
+  cairo_rectangle (cr, 2, 2, width - 4, height - 2);
+  cairo_fill (cr);
+}
+
+static void
+draw_window_left (cairo_t *cr,
+                  int      part,
+                  int      state,
+                  int      width,
+                  int      height)
+{
+  draw_edge (cr, EDGE_RAISED, 0, -2, width + 2, height + 4);
+
+  gtk_cairo_set_source_sys_color (cr, GTK_WIN32_SYS_COLOR_BTNFACE);
+  cairo_rectangle (cr, 2, 0, width - 2, height);
+  cairo_fill (cr);
+}
+
+static void
+draw_window_right (cairo_t *cr,
+                   int      part,
+                   int      state,
+                   int      width,
+                   int      height)
+{
+  draw_edge (cr, EDGE_RAISED, -2, -2, width + 2, height + 4);
+
+  gtk_cairo_set_source_sys_color (cr, GTK_WIN32_SYS_COLOR_BTNFACE);
+  cairo_rectangle (cr, 0, 0, width - 2, height);
+  cairo_fill (cr);
+}
+
+static void
+draw_window_bottom (cairo_t *cr,
+                    int      part,
+                    int      state,
+                    int      width,
+                    int      height)
+{
+  draw_edge (cr, EDGE_RAISED, 0, -2, width, height + 2);
+
+  gtk_cairo_set_source_sys_color (cr, GTK_WIN32_SYS_COLOR_BTNFACE);
+  cairo_rectangle (cr, 2, 0, width - 4, height - 2);
   cairo_fill (cr);
 }
 
@@ -394,6 +438,9 @@ static GtkWin32ThemePart theme_parts[] = {
   { "edit",    9,  0, { 0, 0, 0, 0 }, draw_edit },
   { "tooltip", 1,  0, { 0, 0, 0, 0 }, draw_tooltip },
   { "window",  1,  0, { 0, 0, 0, 0 }, draw_window },
+  { "window",  7,  0, { 0, 0, 0, 0 }, draw_window_left },
+  { "window",  8,  0, { 0, 0, 0, 0 }, draw_window_right },
+  { "window",  9,  0, { 0, 0, 0, 0 }, draw_window_bottom },
   { "window", 15,  0, { 0, 0, 0, 0 }, draw_window_button },
   { "window", 17,  0, { 0, 0, 0, 0 }, draw_window_button },
   { "window", 18,  0, { 0, 0, 0, 0 }, draw_window_button },